from aiogram_dialog import Dialog, Window
from aiogram_dialog.widgets.input import TextInput
from aiogram_dialog.widgets.kbd import Cancel

from poker_bot.tg_bot.dialogs.extras import copy_start_data_to_ctx
from poker_bot.tg_bot.dialogs.widgets import LocaleText
from poker_bot.tg_bot.states import AddAccountSG

from .handlers import create_user_account

enter_account_id_window = Window(
    LocaleText("enter-account-id"),
    TextInput("account_id", int, on_success=create_user_account),
    Cancel(LocaleText("back-btn")),
    state=AddAccountSG.enter_account_id,
)

add_account_dialog = Dialog(enter_account_id_window, on_start=copy_start_data_to_ctx)
